How to use DataSet and Storedprocedure as FastReport DataSource in VS2008
1.I'v generate a DataSet in VS2008 ,and how to use it as FastReport's Datasource in report designer?
2.I droped sqldatasource and webreport component on to default.aspx,and set selectcommand as 'text' and sqlquery retrievedata '33032602001','01/01/2008','12/31/2008','voucher',then set webreport control's datasource as sqldatasource.
but occured an error "error connection or selectcommand syntax error" when I using Intelligence tool to design report
A newbie need help
2.I droped sqldatasource and webreport component on to default.aspx,and set selectcommand as 'text' and sqlquery retrievedata '33032602001','01/01/2008','12/31/2008','voucher',then set webreport control's datasource as sqldatasource.
but occured an error "error connection or selectcommand syntax error" when I using Intelligence tool to design report
A newbie need help
Comments
1) see programmer's manual, "Working with Windows.Forms/Using the Report component in Visual Studio" chapter (if you work with Windows Forms project). If you want to register a DataSet in ASP.NET project, read the "Working with ASP.NET/Registering data" chapter.
2) it's not correct use of SqlDataSource, you have to specify the connection string.
1.I'v read proammer's manual.and registerdata(dataset),but still I dont know how to design report in designer that which datasource is dataset.I'm working with ASP.NET.
2.I'v specified the connectionstring to SqlDataSource, and test correctly when binding it to GridView.
- place Button on your aspx page;
- create the following event handler for it:
Note that this will work only on your local machine. Run your project, press the Button - you will be able to design a report and save it to a file, then use this file in your ASP.NET project. Once you have designed a report, remove this Button and all associated code (or hide it).
To use the report you have designed:
- add report file to your project via Solution Explorer. App_Data folder is good for this;
- put WebReport component on your aspx page;
- go Properties window and invoke the "ReportFile" property editor;
- select App_Data\report.frx file.
To run a report, you need to register the DataSet. Use the WebReport.StartReport event handler:
Secondary how to use SqlDataSource with Storedprocedure,which is success in using a table as a datasource.
Thanks for your help firstly
Another way is to use ObjectDataSource, bind it to your DataSet and then register in a report. This can be done in a visual manner.
I've tested stored proc as well - it works fine (I have a test database with MiProc2 proc with one string parameter).
But I still dont know how to use DataSet as DataSource in VS.
Thanks AlexTZ
Any additional question:
1.I'v set column's size to 'cangrow'.Still, there are many rows' height didnt grow when one column's text is very long and text being clipped.But, some rows work well.It looks like have no regulation.And when change font,rows' height changed with also no regulation.
2.My report have two Databand and one Datahead, on which I put a total column,that on the head of second Databand. But the Datahead content didn't show on the first page when it on first page whereas other pages work well when it on other pages at run time.
3.Does FastReport .net demo version have expiration or client connections limitation?
Best Regards
1,2 - I can't say what's wrong, I need a demo report that demonstrates this behavior.
3 - no it does not.
I tried this as you mention in post#4. But its displaying the data directly from the test.frx file, instead of Dataset.
Please help.
Irfan
The report does not contain any data. It contains datasource schema only. So I don't understand this:
Hey Hurray !! Right, datasource schema... Thanx Alex. Its working now.
i read the post #4 you mentioned as the "run this code in the local machine" that means run this as windows application? or web application.
When select the design report in the webreport component that placed in the aspx page it display the connection wizard window to create new connection in that only display the connection type as MS Access Connection, XMl Databse, OLEDB Connection, MS SQL Connection in that what i choose? to load my dataset. As you mention, i did report.register to register my dataset before that how can i design the report with the fields from the stored procedure. Please guide me i'm in urgent to finish this task.
Hai Alex,
Thanks, I got it. Do you suggest how to do summary report.
Please read the user's manual, it has a chapter "Report creation" which covers all report types.